/*
 * globals.h
 *
 * Group: Fantastic Five
 * Date: 4/25/08
 *
 * Description: Defines global types
 */


/* Enumeration of opcodes, to be used with node structure */
enum opcode {BEG, END, MOV, CLR, CPY, CMP, JZ, JNZ, JMP, JGT, JLT, ADD, SUB, MUL, DIV, INC, DEC, GET, PUT, PTC};

/* Enumeration of registers, to be used with node structure */
enum reg {R0=0, R1=1, R2=2, R3=3, R4=4, R5=5, R6=6, R7=7, RC=8};

/* Enumeration of lexemes, to be used with token structure */
enum lexeme {NONE = -1, INTEGER, FLOAT, REGISTER, OPCODE, CHAR};

/* Holds value (integer, float, register, or opcode) of token */
union value
{
    int i;
    float f;
    char c;
    enum reg r;
    enum opcode op;
};

/* Register struct, includes a value and which register it is */
struct regstr
{
    union value v;
    enum lexeme reg_type;
};

